package cn.xo68.sample.mybaitsdemo.service.impl;

import java.util.List;

import cn.xo68.sample.mybaitsdemo.entity.SysUser;
import cn.xo68.sample.mybaitsdemo.mapper.SysUserMapper;
import cn.xo68.sample.mybaitsdemo.service.SysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;


@Service
public class SysUserServiceImpl implements SysUserService {
	
	private static final Logger logger=LoggerFactory.getLogger(SysUserServiceImpl.class);
	
	@Autowired
	private SysUserMapper sysUserMapper;

	@Override
	public SysUser oneByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return sysUserMapper.selectByPrimaryKey(id);
	}
	
	@Override
	public SysUser getUserByAccount(String account) {
		// TODO Auto-generated method stub
		return sysUserMapper.selectByAccount(account);
	}
	
	@Override
	public int insert(SysUser sysUser) {
		return sysUserMapper.insert(sysUser);
	}

	@Override
	public Page<SysUser> selectAll(){
		Page<SysUser> page = PageHelper.startPage(1, 5,true);		
		 sysUserMapper.selectAll();
		 return page;
	}
}
